<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>es11的特性</title>
</head>
<body>
  
  <script>
    //bigint
    console.log(Number.MAX_SAFE_INTEGER)
    const num1 = 9007199254740992n
    const num2 = 9007199254740993n
    console.log(num1, num2)

    // 空值合并运算
    let info = undefined
    // info = info || "默认值"
    // console.log(info)

    // ??: 空值合并运算符
    info = info ?? "默认值"
    console.log(info)

    //可选链
    const obj = {
      name: "why",
      friend: {
        name: "kobe",
        // running: function() {
        //   console.log("running~")
        // }
      }
    }
       // 3.可选链的用法: ?.
       obj?.friend?.running?.()
  </script>
</body>
</html>